Declare public resources from images that are loaded by name#45421
Closed
Abbondanzo wants to merge 2 commits into
Closed
Declare public resources from images that are loaded by name#45421Abbondanzo wants to merge 2 commits into
Abbondanzo wants to merge 2 commits into
Conversation
Summary: Fresco has indicated that they have no plans to support loading vector assets and similar drawable types in Drawee-backed views ([issue](facebook/fresco#329), [issue](facebook/fresco#1463), [issue](facebook/fresco#2463)). Guidance has been to instead load the vector drawable onto the backing image view ourselves. On the React Native side, having the ability to load vector drawables has been requested many times ([issue](facebook#16651), [issue](facebook#27502)). I went this route over using a custom Fresco decoder for XML assets because vector drawables are compiled down into binary XML and I couldn't find a trivial, performant way to parse those files in a context-aware manner. This change only accounts for vector drawables, not any of the other XML-based drawable types (layer lists, level lists, state lists, 9-patch, etc.). Support could be added easily in the future by expanding the `getDrawableIfUnsupported` function. ## Changelog [Android] [Added] - Added support for rendering XML assets provide to `Image` Differential Revision: D59530172
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59585555 |
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59585555 |
4293bb0 to
3d5cab5
Compare
Base commit: 9d8e52b |
…k#45421) Summary: Pull Request resolved: facebook#45421 RNTester contains Android resources that are loaded by name and not resolved by Metro. As a result, these assets are not automatically linked when RNTester JS code is embedded in other projects. This is considered "legacy" loading and is generally discouraged, but is still showcased as an alernative way of loading resources. I also modified the Image test to ensure that flag status is printed so it's obvious why the vector drawable hasn't loaded. Changelog: [Internal] Reviewed By: javache Differential Revision: D59585555
Contributor
|
This pull request was exported from Phabricator. Differential Revision: D59585555 |
3d5cab5 to
36bed4b
Compare
Contributor
|
This pull request has been merged in 018d062. |
|
This pull request was successfully merged by Peter Abbondanzo in 018d062 When will my fix make it into a release? | How to file a pick request? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
RNTester contains Android resources that are loaded by name and not resolved by Metro. As a result, these assets are not automatically linked when RNTester JS code is embedded in other projects. This is considered "legacy" loading and is generally discouraged, but is still showcased as an alernative way of loading resources.
I also modified the Image test to ensure that flag status is printed so it's obvious why the vector drawable hasn't loaded.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D59585555